Yes. But beware of destroying files you need!
Here is a sample run of the modified program:
C:\temp>java DiscountErr > discount.out Enter list price in cents: 100 Enter discount in percent: 25 Discount Price: 75 C:\temp>type discount.out Price in cents: 100 Discount: 25 Discount Price: 75 C:\temp>
What happened to the previous version of the file discount.out
in the current subdirectory?